<?php
	include_once("login.php");
	$input_user = $_REQUEST["user"];
	$input_pass = $_REQUEST["pass"];

	if (!$input_user || !$input_pass) {
		print "0";
	} else {
		$conn = mysql_connect($host, $user, $passwd);
		if (!$conn) {
			die('Could not connect: ' . mysql_error());
		}

		mysql_select_db($database, $conn);

		$sql = "SELECT
				COUNT(*) AS Total
			FROM 
				Quiz_Users
			WHERE
				Username = '" . $input_user . "'
				AND
				Password = '".$input_pass."'";
		$result = mysql_query($sql);

		while ($row = mysql_fetch_array($result)) {
			print $row["Total"];
		}

		mysql_close($conn);
	}
?>